package com.sunday.factory.singletonDemo;

import java.util.concurrent.atomic.AtomicLong;

/**
 * @ClassName EnumDemo
 * @Author JiangHai
 * @Date 2021/9/5 13:38
 **/
public enum EnumSingleton {
    /**
     *  实例
     */
    INSTANCE;

    private AtomicLong id = new AtomicLong(0);

    public long getId() {
        return id.incrementAndGet();
    }
}
